<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

// 返回首页
const goHome = () => {
  router.push('/')
}

// 返回上一页
const goBack = () => {
  router.go(-1)
}
</script>

<template>
  <div class="not-found">
    <div class="content">
      <img src="https://img.icons8.com/color/240/000000/error--v1.png" alt="404" class="error-image" />
      <h1>404</h1>
      <h2>抱歉，您访问的页面不存在</h2>
      <div class="actions">
        <el-button type="primary" @click="goHome">返回首页</el-button>
        <el-button @click="goBack">返回上一页</el-button>
      </div>
    </div>
  </div>
</template>

<style scoped>
.not-found {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f0f2f5;
}

.content {
  text-align: center;
}

.error-image {
  width: 180px;
  height: 180px;
  margin-bottom: 20px;
}

h1 {
  font-size: 72px;
  color: #409EFF;
  margin: 0;
}

h2 {
  font-size: 24px;
  color: #606266;
  margin: 20px 0;
}

.actions {
  margin-top: 30px;
}

.actions .el-button {
  margin: 0 10px;
}
</style> 